<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var str = 'a=A&b=B&c=C&d=D';

  function getObj(str) {
    //str = str.replace(/=/g, ':');
    str = str.split('&');
    var obj = {};
    for (var i = 0, arr; i < str.length; i++) {
      arr = str[i].split('=');
      obj[arr[0]] = arr[1]
    }
    return obj
  }

  var obj = getObj(str)
  console.log(obj.a)
</script>
</body>
</html>